package cn.lzj.basic.service.impl;

import cn.lzj.basic.service.IBaiduAiAuditService;
import cn.lzj.basic.util.BaiduAuditUtils;
import cn.lzj.pet.domain.Pet;
import org.springframework.stereotype.Service;

@Service
public class BaiduAiAuditServiceImpl implements IBaiduAiAuditService {
    @Override
    public Boolean textAudit(String text) {
        //1.获取文本
        Pet pet = new Pet();
        String petName = pet.getName();
        //2.调用百度审核接口审核文本
        Boolean textBoo = BaiduAuditUtils.TextCensor(petName);
        if (textBoo) {
            //3.审核成功，返回true，失败返回false
            return true;
        } else {
            return false;
        }
    }
    @Override
    public Boolean imageAudit(String resources) {
        //1.获取文本
        Pet pet = new Pet();
        String petName = pet.getName();
        //2.调用百度审核接口审核文本
        Boolean imageBoo = BaiduAuditUtils.TextCensor(petName);
        if (imageBoo) {
            //3.审核成功，返回true，失败返回false
            return true;
        } else {
            return false;
        }
    }
}
